@extends('admin.layout')
@section('content')
	      <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                内容管理
                <small>Preview</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li><a href="#">Forms</a></li>
                <li class="active">General Elements</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">内容添加</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('/admin/goods/insert') }}" method='post' enctype="multipart/form-data">
                        {{ csrf_field() }}
                        @if(session('info'))
                            <div class="alert alert-success alert-dismissable">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <h4><i class="icon fa fa-warning"></i> 警告!</h4>
                                 <ul>
                                    {{ session('info') }}
                                 </ul>
                                </div>                              
                            @endif  	


                        	@if(count($errors) > 0)
                        	<div class="alert-danger alert-dismissable">
                        		<button aria-hidden="true" data-dismiss="alert" class='close' type='button'>x</button>
								<h4><i class='icon fa fa-ban'></i> 警告!</h4>
								<ul>
									@foreach ($errors->all() as $error)
										<li>{{ $error }}</li>
									@endforeach		
								</ul>
                        	</div>
                        	@endif
                        	


                            <div class="box-body">
                                <input type="hidden" name='user_id' value="{{ session('master1') -> id }}">
                              <div class="form-group">
                                    <label for="exampleInputFile">头部图片</label>
                                    <input type="file" name='img_head' value="{{ old('img_head') }}" id="exampleInputFile">
                                    <p class="help-block">请在这里添加头部图片</p>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputName1">标题</label>
                                    <input name='title' type="text" value="{{ old('title') }}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请在此处输入文章内容">
                                </div>

                                 <div class="form-group">
                                    <label for="exampleInputName1">标签</label>
                                    <input name='label' type="text" value="{{ old('label') }}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入标签">
                                </div>
                                 <div class="form-group">
                                    <label for="exampleInputName1">摘要</label>
                                    <input name='abstract' type="text" value="{{ old('abstract') }}" class="form-control" id="exampleInputEmail1"
                                           placeholder="请输入文章摘要">
                                </div>
                                <div class="form-group">
                                    <label>内容分类</label>
                                    <select name='cate_id' class="form-control">
                                            <option value='0'>根分类</option>
                                           @foreach($data as $cate)
                                           <option value='{{ $cate -> id }}'>{{ $cate -> name }}</option>
                                           @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>首页显示样式</label>
                                    <select name='zstyle' class="form-control">
                                           <option value='0'>黑色小方块</option>
                                           <option value='1'>2个方块样式</option>
                                           <option value='2' selected>白色小方块</option>
                                           <option value='3'>3个方块样式</option>
                                           
                                    </select>
                                </div>

                                 <div class="form-group">
                                    <label for="exampleInputName1">内容详情</label>
                                       <!-- 加载编辑器的容器 -->
                                        <script id="container" name="detail" style='width:100%;height:400px' type="text/plain">这里写你的初始化内容</script>
                                        <!-- 配置文件 -->
                                        <script type="text/javascript" src="{{ url('/adm/ue/ueditor.config.js') }}"></script>
                                        <!-- 编辑器源码文件 -->
                                        <script type="text/javascript" src="{{ url('/adm/ue/ueditor.all.js') }}"></script>
                                        <!-- 实例化编辑器 -->
                                        <script type="text/javascript">
                                            var ue = UE.getEditor('container');
                                        </script>
                                </div>
                               
                            </div><!-- /.box-body -->

                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">添加</button>
                            </div>
                        </form>
                    </div><!-- /.box -->

  
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->内容添加
@endsection('content')